package problem;

import org.graphstream.algorithm.generator.BarabasiAlbertGenerator;
import org.graphstream.algorithm.generator.WattsStrogatzGenerator;
import org.graphstream.graph.Graph;
import org.graphstream.graph.implementations.SingleGraph;

public class Generator {

	public void generateBarabasiAlbertGraph(String graphID, int n, int maxLinksPerStep){
		Graph graph = new SingleGraph(graphID);
		//Between 1 and maxLinksPerStep new links per node added.
		BarabasiAlbertGenerator gen = new BarabasiAlbertGenerator(maxLinksPerStep);
		//Generate n nodes:
		gen.addSink(graph);
		gen.begin();
		for(int i=0; i<n; i++) {
			gen.nextEvents();
		}
		gen.end();
	}
	
	public void generateSmallWorldGraph(String graphID, int n, int k, double beta){
		Graph graph = new SingleGraph(graphID);
		WattsStrogatzGenerator gen = new WattsStrogatzGenerator(n, k, beta);
		gen.addSink(graph);
		gen.begin();
		while(gen.nextEvents()) {}
		gen.end();
	}
	
}
